package com.sharp.core.voxel;

import java.util.ArrayList;
import java.util.List;

import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;

public class VoxelRenderList {

	private List<Vector3f> vertices = new ArrayList<Vector3f>();
	private List<Float> colors = new ArrayList<Float>();
	
	public void addVertex(Vector3f vertex) {
		vertices.add(vertex);
	}
	
	public void addColor(ColorRGBA color) {
		colors.add(color.getRed());
		colors.add(color.getGreen());
		colors.add(color.getBlue());
		colors.add(color.getAlpha());
	}
	
	public Vector3f[] getVertices() {
		return vertices.toArray(new Vector3f[0]);
	}
	
	/*public ColorRGBA[] getColors() {
		return colors.toArray(new ColorRGBA[0]);
	}*/
	
	public float[] getColors() {
		float[] ret = new float[colors.size()];
		for ( int i = 0; i < ret.length; ++i )
			ret[i] = colors.get(i);
		return ret;
	}

	public void addVertices(List<Vector3f> list) {
		vertices.addAll(list);
	}
	
}
